<%@page import="com.tutu.common.GlobalConstants"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>

<!DOCTYPE html>
<html lang="cn">
<head>
	<title><sitemesh:write property='title' /></title>
	<meta charset="UTF-8" />
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<link rel="stylesheet" href="${pageContext.request.contextPath }/css/bootstrap.min.css" />
	<link rel="stylesheet" href="${pageContext.request.contextPath }/css/bootstrap-responsive.min.css" />
	<link rel="stylesheet" href="${pageContext.request.contextPath }/css/fullcalendar.css" />
	<link rel="stylesheet" href="${pageContext.request.contextPath }/css/uniform.css" />
	<link rel="stylesheet" href="${pageContext.request.contextPath }/css/select2.css" />
	<link rel="stylesheet" href="${pageContext.request.contextPath }/css/matrix-style.css" />
	<link rel="stylesheet" href="${pageContext.request.contextPath }/css/matrix-media.css" />
	<link rel="stylesheet" href="${pageContext.request.contextPath }/font-awesome/css/font-awesome.css" />
	<link rel="stylesheet" href="${pageContext.request.contextPath }/css/jquery.gritter.css" />
	<!-- <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,800' rel='stylesheet' type='text/css'> -->
	<script type="text/javascript" src="${pageContext.request.contextPath }/js/excanvas.min.js"></script> 
	<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery.min.js"></script> 
	<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery.ui.custom.js"></script> 
	<script type="text/javascript" src="${pageContext.request.contextPath }/js/bootstrap.min.js"></script> 
	<%-- <script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery.flot.min.js"></script> 
	<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery.flot.resize.min.js"></script>  
	<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery.peity.min.js"></script> --%>
	<script type="text/javascript" src="${pageContext.request.contextPath }/js/fullcalendar.min.js"></script> 
	<script type="text/javascript" src="${pageContext.request.contextPath }/js/matrix.js"></script> 
	<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery.gritter.min.js"></script> 
	<%-- <script type="text/javascript" src="${pageContext.request.contextPath }/js/matrix.dashboard.js"></script>  
	<script type="text/javascript" src="${pageContext.request.contextPath }/js/matrix.interface.js"></script> 
	<script type="text/javascript" src="${pageContext.request.contextPath }/js/matrix.chat.js"></script> --%>
	<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery.validate.js"></script> 
	<script type="text/javascript" src="${pageContext.request.contextPath }/js/localization/messages_zh.min.js"></script> 
	<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery.validate.methods.js"></script> 
	<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery.wizard.js"></script> 
	<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery.uniform.js"></script> 
	<script type="text/javascript" src="${pageContext.request.contextPath }/js/select2.min.js"></script> 
	<script type="text/javascript" src="${pageContext.request.contextPath }/js/matrix.popover.js"></script> 
	<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery.dataTables.min.js"></script> 
	<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery.tmpl.min.js"></script> 
	<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery.form-3.51.js"></script> 
	<script type="text/javascript" src="${pageContext.request.contextPath }/js/matrix.tables.js"></script> 
	<script type="text/javascript" src="${pageContext.request.contextPath }/dwr/engine.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath }/dwr/util.js"></script>
	<script id="tmpl_alert" type="text/x-jquery-tmpl">
	<div class="alert alert-{{= type}}">
      <button type="button" class="close" data-dismiss="alert">&times;</button>
      <strong>{{= title}}</strong> {{= message}}
    </div>
	</script>
	<script id="tmpl_modal" type="text/x-jquery-tmpl">
	<div id="{{= modelId}}" class="modal hide">
      <div class="modal-header">
        <button data-dismiss="modal" class="close" type="button">×</button>
        <h3>{{= modelTitle}}</h3>
      </div>
      <div class="modal-body">
      {{= modelContent}}
      </div>
      <div class="modal-footer"> <button type="button" class="btn btn-primary">确定</button> <a data-dismiss="modal" class="btn" href="#">取消</a> </div>
    </div>
	</script>
	<script type="text/javascript">
	<!--
	$(function(){
		dwr.engine.setActiveReverseAjax(true);
		//dwr.engine.setNotifyServerOnPageUnload(true,true);
		dwr.engine._errorHandler = function(message, ex) {
			dwr.engine._debug("Error: " + ex.name + ", " + ex.message, true);
		}
	});
	
	/**
	推送消息
	*/
	function updateUserMsg(msgNum, title, text){
		var msgNumTxt = $("#msgNum").text();
		if($.isNumeric(msgNumTxt)){
			$("#msgNum").text(parseInt(msgNumTxt)+1);
		}else{
			$("#msgNum").text(1);
		}
		$.gritter.add({
			title:	title,
			text:	text,
			image:  '${pageContext.request.contextPath }/img/demo/envelope.png',
			sticky: true
		});
	}
	
	var __ctx = "${pageContext.request.contextPath}";
	<c:if test="${sessionScope.SESSION_MESSAGE ne null }">
	<c:set var="sessionMessage" value="${sessionScope.SESSION_MESSAGE}"></c:set>
	$(function(){
	<c:if test="${true eq sessionMessage.isSuccess }">
	$("#tmpl_alert").tmpl({type:"success", title:"成功",message:"${sessionMessage.returnObject }"}).appendTo("#message_alert");
	</c:if>
	<c:if test="${false eq sessionMessage.isSuccess }">
	$("#tmpl_alert").tmpl({type:"error", title:"失败",message:"${sessionMessage.errorMsg }"}).appendTo("#message_alert");
	</c:if>
	});
	<c:remove var="SESSION_MESSAGE" scope="session"/>
	</c:if>
	//-->
	</script>
	<sitemesh:write property='head' />
</head>
<body>
<!--Header-part-->
<div id="header">
  <h1><a href="dashboard.html">MEOA</a></h1>
</div>
<!--close-Header-part--> 

<!--top-Header-menu-->
<div id="user-nav" class="navbar navbar-inverse">
  <ul class="nav">
    <li  class="dropdown" id="profile-messages" ><a title="" href="#" data-toggle="dropdown" data-target="#profile-messages" class="dropdown-toggle"><i class="icon icon-user"></i>  <span class="text"><%= GlobalConstants.getCurrentUser().getUsername() %></span><b class="caret"></b></a>
      <ul class="dropdown-menu">
        <li><a href="${pageContext.request.contextPath }/sysuser/getMyUser.do"><i class="icon-user"></i> 我的信息</a></li>
        <!-- <li class="divider"></li>
        <li><a href="#"><i class="icon-check"></i> My Tasks</a></li> -->
        <li class="divider"></li>
        <li><a href="${pageContext.request.contextPath }/logout"><i class="icon-key"></i> 退出</a></li>
      </ul>
    </li>
    <li class="dropdown" id="menu-messages"><a href="#" data-toggle="dropdown" data-target="#menu-messages" class="dropdown-toggle"><i class="icon icon-envelope"></i> <span class="text">消息</span> <span id="msgNum" class="label label-important">${requestScope.msgCount }</span> <b class="caret"></b></a>
      <ul class="dropdown-menu">
        <li><a class="sAdd" title="发送消息" href="${pageContext.request.contextPath }/msg/createSysMsg.do"><i class="icon-plus"></i> 发送消息</a></li>
        <li class="divider"></li>
        <li><a class="sInbox" title="收件箱" href="${pageContext.request.contextPath }/msg/queryMyMsg.do"><i class="icon-envelope"></i> 收件箱</a></li>
        <li class="divider"></li>
        <li><a class="sOutbox" title="发件箱" href="${pageContext.request.contextPath }/msg/querySent.do"><i class="icon-arrow-up"></i> 发件箱</a></li>
        <!-- <li class="divider"></li>
        <li><a class="sTrash" title="" href="#"><i class="icon-trash"></i> trash</a></li> -->
      </ul>
    </li>
    <li class=""><a title="" href="${pageContext.request.contextPath }/logout"><i class="icon icon-share-alt"></i> <span class="text">退出</span></a></li>
  </ul>
</div>
<!--close-top-Header-menu-->
<!--start-top-serch-->
<!--<div id="search">
  <input type="text" placeholder="Search here..."/>
  <button type="submit" class="tip-bottom" title="Search"><i class="icon-search icon-white"></i></button>
</div>
close-top-serch-->
<!--sidebar-menu-->
<div id="sidebar"><a href="#" class="visible-phone"><i class="icon icon-home"></i> Dashboard</a>
  <ul>
  <c:forEach var="sysMenuInfo" items="${sessionScope.SESSION_USER_MENU }" varStatus="status">
  <c:if test="${not empty sysMenuInfo.sonSysMenuInfos }">
  	<c:if test="${sysMenuInfo.isActive }">
    <li class="submenu open active">
  	</c:if>
  	<c:if test="${not sysMenuInfo.isActive }">
    <li class="submenu">
  	</c:if>
  </c:if>
  <c:if test="${empty sysMenuInfo.sonSysMenuInfos }">
    <c:if test="${sysMenuInfo.isActive }">
    <li class="active">
  	</c:if>
  	<c:if test="${not sysMenuInfo.isActive }">
    <li>
  	</c:if>
  </c:if>
    <a href="${pageContext.request.contextPath }${sysMenuInfo.menuUrl }"><c:if test="${sysMenuInfo.menuIcon ne null}"><i class="icon ${sysMenuInfo.menuIcon }"></i></c:if> <span>${sysMenuInfo.menuName }</span><c:if test="${not empty sysMenuInfo.sonSysMenuInfos }"><span class="label label-important">${fn:length(sysMenuInfo.sonSysMenuInfos) }</span></c:if></a>
    <c:if test="${not empty sysMenuInfo.sonSysMenuInfos }">
    <ul>
    <c:forEach var="sonMenuInfo" items="${sysMenuInfo.sonSysMenuInfos }">
    <c:if test="${sonMenuInfo.isActive }">
    <li class="active">
    </c:if>
    <c:if test="${not sonMenuInfo.isActive }">
    <li>
    </c:if>
    <a href="${pageContext.request.contextPath }${sonMenuInfo.menuUrl}"><span>${sonMenuInfo.menuName}</span></a></li>
    </c:forEach>
    </ul>
    </c:if>
    </li>
  </c:forEach>
  </ul>
</div>
<!--sidebar-menu-->

<!--main-container-part-->
<div id="content">
<!--breadcrumbs-->
  <div id="content-header">
    <div id="breadcrumb"><a href="${pageContext.request.contextPath }/index.do" title="首页" class="tip-bottom"><i class="icon-home"></i> 首页</a>
    <c:forEach var="sysMenuInfo" items="${sessionScope.SESSION_USER_MENU }" >
    <c:if test="${sysMenuInfo.isActive }">
    <c:if test="${not empty sysMenuInfo.sonSysMenuInfos }"><a href="#" class="tip-bottom" title="${sysMenuInfo.menuName }">${sysMenuInfo.menuName }</a><c:forEach var="sonMenuInfo" items="${sysMenuInfo.sonSysMenuInfos }"><c:if test="${sonMenuInfo.isActive }"><a href="${pageContext.request.contextPath }${sonMenuInfo.menuUrl }" class="current tip-bottom" title="${sonMenuInfo.menuName }">${sonMenuInfo.menuName }</a></c:if></c:forEach></c:if>
    <c:if test="${empty sysMenuInfo.sonSysMenuInfos }"><a href="${pageContext.request.contextPath }${sysMenuInfo.menuUrl }" class="current tip-bottom" title="${sysMenuInfo.menuName }">${sysMenuInfo.menuName }</a></c:if>
    </c:if>
    </c:forEach>
    </div>
  </div>
<!--End-breadcrumbs-->
	<div class="container-fluid">
		<div id="message_alert" class="row-fluid"></div>
	</div>
	<sitemesh:write property="body" />
<!--Action boxes-->
</div>
<!--end-main-container-part-->

<!--Footer-part-->

<div class="row-fluid">
  <div id="footer" class="span12"> 2015 &copy; MEOA.   </div>
</div>
<!--end-Footer-part-->
</body>
</html>
